<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>

<body>
  <div id="app">
    <h1 v-style="{fontSize:'50px',color:'red'}">2001</h1>
    <input type="text" v-focus>
  </div>
  <script>

    Vue.directive('focus', {
      inserted(el) {
        console.log(el)
        el.focus();
      }
    })

    Vue.directive('style',{
      inserted(){
        console.log(arguments)
      },
      bind(el,params){
        console.log(arguments)
        for(key in params.value){
          el.style[key]=params.value[key]
        }
      }
    })

    var vm = new Vue({
      el: "#app"
    })

  </script>
</body>

</html>